package vn.fpt.fsoft.wed.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import vn.fpt.fsoft.business.ServiceBus;
import vn.fpt.fsoft.common.exception.MyException;
import vn.fpt.fsoft.entities.Service;

@Controller
public class ServiceAction {
	
	
	



	@Autowired
	ServiceBus serviceBus;
	
	public void setServiceBus(ServiceBus serviceBus) {
		this.serviceBus = serviceBus;
	}
	@RequestMapping(value="/service",method=RequestMethod.GET)
	public ModelAndView getListService(){
		List<Service> service = null;
		try {
			service = serviceBus.getAll();
		} catch (MyException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return new ModelAndView("listService", "listService", service);
		
	}

}
